import library.util.*;


public class LoopBufferTest {

	public static void main(String[] args) {
		LoopBufferI lb = new LoopBuffer();
		int icount_max = 10;
		int icount = 0;
		int value = 0;
		int itmp;
		lb.setBufferSize(10);
		while(icount < 2*icount_max)
		{
			System.out.println("put value = " + value);
			itmp = lb.add(new Integer(value++));
			System.out.println("next index = " + itmp);
          icount ++;
		}
		
		icount = 0;
		while(icount < icount_max/2)
		{
          System.out.println(lb.get());
          icount ++;
		}
    
		icount = 0;
		while(icount < 2*icount_max)
		{
			System.out.println("++put value = " + value);
			itmp = lb.add(new Integer(value++));
			System.out.println("++next index = " + itmp);
          icount ++;
		}
		
		icount = 0;
		while(icount < icount_max/2)
		{
          System.out.println(lb.get());
          icount ++;
		}
	}

}
